import { http } from '@/tool/utils'
import { iPb } from '@/protobuf/interface'

export function ListArticleGroup(data: iPb.Admin.IListArticleGroupRequest):Promise<iPb.Admin.IListArticleGroupResponse> {
    return http.post("ListArticleGroup",iPb.Admin.ListArticleGroupRequest.toObject(iPb.Admin.ListArticleGroupRequest.create(data)))
}

export function CreateArticleGroup(data: iPb.IDbArticleGroup):Promise<iPb.Admin.ICreateArticleGroupResponse> {
    return http.post("CreateArticleGroup",iPb.DbArticleGroup.toObject(iPb.DbArticleGroup.create(data)))
}

export function UpdateArticleGroup(data: iPb.IDbArticleGroup):Promise<iPb.Admin.IUpdateArticleGroupResponse> {
    return http.post("UpdateArticleGroup",iPb.DbArticleGroup.toObject(iPb.DbArticleGroup.create(data)))
}

export function ReadArticleGroup(formData: iPb.Admin.IReadArticleGroupRequest):Promise<iPb.IDbArticleGroup> {
    return http.post("ReadArticleGroup",iPb.Admin.ReadArticleGroupRequest.create(formData))
}

export function DeleteArticleGroup(formData: iPb.Admin.IDeleteArticleGroupRequest):Promise<iPb.Admin.IDeleteArticleGroupResponse> {
    return http.post("DeleteArticleGroup",iPb.Admin.DeleteArticleGroupRequest.create(formData))
}